package dao.logindao;

import java.sql.PreparedStatement;
import beans.LoginBeans;
import conexao.Conexao;
import java.sql.SQLException;


public class LoginDao {

       private static class Login {

        public Login() {
        }
    }
    
    public LoginDao(){
    
    }    
     public boolean grava(LoginBeans usuario) {
        boolean gravou = false;
        String sql = "INSERT INTO login VALUES(?,?,?,?)";
        try {
            PreparedStatement comandoSQL = Conexao.getInstance().prepareStatement(sql);            
            comandoSQL.setInt(1, 0);
            comandoSQL.setString(2, usuario.getLogNome());
            comandoSQL.setString(3, usuario.getLogLogin());
            comandoSQL.setString(4, usuario.getLogSenha());
            comandoSQL.execute();
            Conexao.getInstance().commit();
            gravou = true;
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
        return gravou;
    }
    

}
        


 
   

 

    
    
    

